package photoPrint;
import java.io.Serializable;

import dataStructures.Queue;
import dataStructures.QueueInList;


/**
 * Classe que representa um objecto do TADAlbum
 * 
 * @author filiperosa
 *
 */
public class AlbumClass implements TADAlbum, Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3502389952864466990L;
	private String code;
	private Queue<TADPhoto> list;
	private boolean status;
	private int biggestWidth;
	private int biggestHeight;
	
	public AlbumClass(String code){
		this.code=code;
		list = new QueueInList<TADPhoto>();
		status = true;
		biggestWidth = 0;
		biggestHeight = 0;
	}

	/* (non-Javadoc)
	 * @see TADAlbum#getCode()
	 */
	@Override
	public String getCode() {
		return code;
	}

	/* (non-Javadoc)
	 * @see TADAlbum#addPhoto(TADPhoto)
	 */
	@Override
	public boolean addPhoto(TADPhoto photo) {
		if (photo.getWidth()>biggestWidth){
			biggestWidth=photo.getWidth();}
		if (photo.getHeight()>biggestHeight){
			biggestHeight=photo.getHeight();}
		list.enqueue(photo);
		return true;
	}
	

	/* (non-Javadoc)
	 * @see TADAlbum#status()
	 */
	@Override
	public boolean status() {
		return status;
	}

	/* (non-Javadoc)
	 * @see TADAlbum#changeStatus()
	 */
	@Override
	public void changeStatus() {
		status=false;
	}

	/* (non-Javadoc)
	 * @see TADAlbum#photosInside()
	 */
	@Override
	public int photosInside() {
		return list.size();
	}

	/* (non-Javadoc)
	 * @see TADAlbum#biggestWidth()
	 */
	@Override
	public int biggestWidth() {
		return biggestWidth;
	}

	/* (non-Javadoc)
	 * @see TADAlbum#biggestHeight()
	 */
	@Override
	public int biggestHeight() {
		return biggestHeight;
	}

	@Override
	public Queue<TADPhoto> getPhotos() {
		return list;
	}
	
	

}
